The present invention relates to an encoder and a decoder for use in a digital transmission of video signals, and more particular to an encoder and a decoder for respectively encoding and decoding video signals including halftones.
Video signals obtained by scanning a pictorial advertisement, a photograph or the like with a scanner usually are analog signals having halftones. One of the prior art methods of converting such analog video signals into binary signals is to convert the analog signals to pseudo-halftone signals by an ordered diether method. This method generates a bit sequence of "1" and "0". The consecutive black and white lengths of this signal sequence is run-length encoded.
The ordered dither method uses an n-by-n dither matrix storing thresholds for conversion into a bit sequence consisting of "1" and "0" codes. The thresholds periodically vary in the directions of the main scan and the subscan. Thus, an analog video signal sequence representing gray is converted into a bit sequence of periodic black and white pixels. Accordingly, the run-length is short and the number of runs is great. Therefore, the compression efficiency of the run-length encoding is extremely low. The U.S. Pat. No. 4,475,127 reveals a preprocessing circuit (logic converter circuit) for a run-length encoding, at a high compression efficiency, of signal sequences which are obtained by the ordered dither method.
This preprocessing circuit converts a signal sequence consisting of "1" and "0" codes, in which white and black pixels periodically alternate, into a new signal sequence in which the run-lengths of "1" and "0" are greater. The preprocessing circuit includes a circuit for generating a signal indicating whether a sum of a number of n signals is an odd or even number. These n signals comprise an input signal and signals produced by delaying that input signal by 1, 2, 3 . . . , (n-1) sampling periods.
Such a prior art encoder for halftone signals is usually structured to permit the operator to choose, on every occasion of transmission, whether run-length encoding of the pseudo-halftone signals preprocessed to be transmitted or run-length encoding of unpreprocessed signals are to be sent. The conventional preprocessing circuit, though having the advantage of extending the run-length of pseudo-halftone signals, such as dither signals or mesh-point signals, also has an effect which shortens the run-length of non-halftone binary signals. It has the disadvantage of a lower compression efficiency in the run-length encoding of preprocessed signals than the compression efficiency of unpreprocessed signals where halftone pictures and non-halftone pictures, such as characters, are coexistent on a document.